package com.hycat.mail.common.config;

import com.hycat.mail.common.interceptor.AuthInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * 拦截器设置
 * @author 吕泽浩业
 * @version 1.0
 */
@Configuration
public class MyWebConfig implements WebMvcConfigurer {

    @Autowired
    private AuthInterceptor authInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authInterceptor).addPathPatterns(
                "/cart/**",
                "/order/order/orderView",
                "/order/order/orderPay"
        //执行顺序
        ).order(1);
    }
}
